package com.yc.boot.work.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yc.boot.work.model.TestClassInfo;
import com.yc.boot.work.model.TestClassTeacherNode;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Create with IntelliT IDEA
 *
 * @Author: zhengmingzhe
 * @Date: 2021/12/16/16:45
 * @Description:
 */
@Mapper
public interface TestPartClassAndTeacherMapper extends BaseMapper<TestClassTeacherNode> {

    @Select("select c.id,c.name as className, t.name as teacherName from test_class as c left join test_class_teacher as z "
            +"on c.id =z.class_id left join test_teacher as t on z.teacher_id =t.id  ${ew.customSqlSegment}")
    List<TestClassTeacherNode> queryClassAndTeacher(@Param(Constants.WRAPPER) LambdaQueryWrapper<TestClassTeacherNode> wrapper);


}
